package anaydis.sort.provider;

import anaydis.sort.Sorter;
import anaydis.sort.SorterType;
import com.sun.istack.internal.NotNull;

/**
 * Analisis y Diseno de Algoritmos - Practica 2011
 * 
 * {@link anaydis.sort.provider.SorterProvider provider} will instanciate each and every implemented {@link anaydis.sort.Sorter sorter}
 */
public interface SorterProvider
{
    /**
     * Given the SorterType, this method will return the corresponding {@link anaydis.sort.Sorter sorter}
     *
     * If given type is not yet implemented, an IllegalArgumentException must be thrown
     *
     * IMPLEMENTATION NOTE: Internally all sorters should be held with a map
     * (e.g.: Map<SorterType, Sorter> sorters = new EnumMap<SorterType, Sorter>)
     *
     * @param type Sorter's type
     * @return corresponding Sorter
     */
    @NotNull Sorter getSorterForType(@NotNull final SorterType type);

    @NotNull Iterable<Sorter> getAllSorters();
}
